From: Daniel van Vugt Date: Tue, 24 Jun 2025 06:59:21 +0000 (+0800) Subject: extensions-tool: Fix security warnings about format string injection X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~124^2^2~28 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ff4fe62c91039b6533537744ee4c85dd80a1b922;p=gnome-shell.git extensions-tool: Fix security warnings about format string injection Fixes: ``` ../subprojects/extensions-tool/src/command-upload.c: In function ‘response_get_token’: ../subprojects/extensions-tool/src/command-upload.c:126:7: warning: format not a string literal and no format arguments [-Wformat-security] 126 | g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, msg); | ^~~~~~~~~~~ ../subprojects/extensions-tool/src/command-upload.c: In function ‘session_get_login_token’: ../subprojects/extensions-tool/src/command-upload.c:294:20: warning: format not a string literal and no format arguments [-Wformat-security] 294 | detail ? detail : soup_status_get_phrase (status)); | ^~~~~~ ../subprojects/extensions-tool/src/command-upload.c: In function ‘session_upload_file’: ../subprojects/extensions-tool/src/command-upload.c:357:20: warning: format not a string literal and no format arguments [-Wformat-security] 357 | detail ? detail : soup_status_get_phrase (status)); | ^~~~~~ ``` Part-of: --- diff --git a/subprojects/extensions-tool/src/command-upload.c b/subprojects/extensions-tool/src/command-upload.c index d427f7cdb..396b55a9e 100644 --- a/subprojects/extensions-tool/src/command-upload.c +++ b/subprojects/extensions-tool/src/command-upload.c @@ -123,7 +123,7 @@ out: else msg = "Invalid token"; - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, msg); + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "%s", msg); return NULL; } @@ -291,7 +291,7 @@ session_get_login_token (SoupSession *session, const char *detail = response_get_detail (response); g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - detail ? detail : soup_status_get_phrase (status)); + "%s", detail ? detail : soup_status_get_phrase (status)); return NULL; } @@ -354,7 +354,7 @@ session_upload_file (SoupSession *session, const char *detail = response_get_detail (response); g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - detail ? detail : soup_status_get_phrase (status)); + "%s", detail ? detail : soup_status_get_phrase (status)); return FALSE; }